<%@ page language="java"  pageEncoding="utf-8"%> 
<%@taglib uri="/WEB-INF/struts-tags.tld" prefix="s"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>黄浦教育</title>
<%@include file="../common/jscss.jsp" %>
</head>

<body>
	<!-- head -->
	<%@include file="../common/header.jsp" %>
    <!-- head--end -->
    
    <!-- body -->
    <div class="content">
    	<div class="clearfix all_view">
            <div class="i_left" id="schedule_list">
            	<div class="i_pd_s1">
                	
                    <!-- zhaosheng -->
                    <s:if test="%{(highList != null && highList.size()>0) || (middelList != null && middelList.size() > 0) || (startList != null && startList.size() > 0)}">
                	<div class="info_box">
                    	<h3>
                        	<img src="images/other/title_1.jpg" />
                            <span>招生</span>
                        </h3>
                        <s:if test="highList.size() > 0">
	                        <div class="info_det_s1">
	                        	<h4>
	                            	<a href="news!view.do?category=1" class="more">MORE</a>
	                                <span>高招信息<i>>>></i></span>
	                                <ul class="tabs_nav">
	                                	<li class="current"><a href="javascript:void(0);">全部</a></li>
	                                	<li ><a href="javascript:void(0);">政策</a></li>
	                                    <li ><a href="javascript:void(0);">信息</a></li>
	                                </ul>
	                            </h4>
	                            <div class="tabs_box tabs">
	                                <ul>
	                                	<s:iterator id="high" value="highList" status="status">
	                                		<li  <s:if test="type == 1">class='zc'</s:if><s:if test="type == 2">class='xx'</s:if>>
		                                    	<span class="time"><s:date name="modifyDate" format="yyyy-MM-dd" /></span>
		                                        <a href="news!read.do?id=<s:property value="id"/>" title="<s:property value="title"/>"><s:property value="title"/></a>
		                                    	<s:if test="isNew">
		                                    	<i class="new"></i>
		                                    	</s:if>
		                                    </li>
	                                	</s:iterator>
	                                	
	                                                                      
	                                </ul>
	                        	</div>
	                            
	                        </div>
                        </s:if>
                         <s:if test="middelList.size() > 0">
	                        <div class="info_det_s1">
	                        	<h4>
	                            	<a href="news!view.do?category=2" class="more">MORE</a>
	                                <span>中招信息<i>>>></i></span>
	                                <ul class="tabs_nav">
	                                	<li class="current"><a href="javascript:void(0);">全部</a></li>
	                                	<li ><a href="javascript:void(0);">政策</a></li>
	                                    <li ><a href="javascript:void(0);">信息</a></li>
	                                </ul>
	                            </h4>
	                            <div class="tabs_box tabs">
	                                <ul>
	                                	<s:iterator id="middel" value="middelList" status="status">
	                                		<li  <s:if test="type == 1">class='zc'</s:if><s:if test="type == 2">class='xx'</s:if>>
		                                    	<span class="time"><s:date name="modifyDate" format="yyyy-MM-dd" /></span>
		                                        <a href="news!read.do?id=<s:property value="id"/>" title="<s:property value="title"/>"><s:property value="title"/></a>
		                                    	<s:if test="isNew">
		                                    	<i class="new"></i>
		                                    	</s:if>
		                                    </li>
	                                	</s:iterator>
	                                                                      
	                                </ul>
	                        	</div>
	                            
	                        </div>
                        </s:if>
                        <s:if test="startList.size() > 0">
	                        <div class="info_det_s1">
	                        	<h4>
	                            	<a href="news!view.do?category=3" class="more">MORE</a>
	                                <span>初中招生<i>>>></i></span>
	                                <ul class="tabs_nav">
	                                	<li class="current"><a href="javascript:void(0);">全部</a></li>
	                                	<li ><a href="javascript:void(0);">政策</a></li>
	                                    <li ><a href="javascript:void(0);">信息</a></li>
	                                </ul>
	                            </h4>
	                            <div class="tabs_box tabs">
	                                <ul>
	                                	<s:iterator id="startList" value="startList" status="status">
	                                		<li  <s:if test="type == 1">class='zc'</s:if><s:if test="type == 2">class='xx'</s:if>>
		                                    	<span class="time"><s:date name="modifyDate" format="yyyy-MM-dd" /></span>
		                                        <a href="news!read.do?id=<s:property value="id"/>" title="<s:property value="title"/>"><s:property value="title"/></a>
		                                    	<s:if test="isNew">
		                                    	<i class="new"></i>
		                                    	</s:if>
		                                    </li>
	                                	</s:iterator>
	                                                                      
	                                </ul>
	                        	</div>
	                            
	                        </div>
                        </s:if>
                    </div>
                    </s:if>
                    <!-- xueye -->
                    <s:if test="examList.size() > 0">
                   	<div class="info_box">
                    	<h3>
                        	<img src="images/other/title_1.jpg" />
                            <span>学业</span>
                        </h3>
                        <div class="info_det_s1">
                        	<h4>
                            	<a href="news!view.do?category=6" class="more">MORE</a>
                                <span>学业考试</span>
                                <ul class="tabs_nav">
                                	<li class="current"><a href="javascript:void(0);">全部</a></li>
                                	<li ><a href="javascript:void(0);">政策</a></li>
                                    <li ><a href="javascript:void(0);">信息</a></li>
                                </ul>
                            </h4>
                           <div class="tabs_box tabs">
                                <ul>
                                	<s:iterator id="exam" value="examList" status="status">
                                		<li  <s:if test="type == 1">class='zc'</s:if><s:if test="type == 2">class='xx'</s:if>>
	                                        <span class="time"><s:date name="modifyDate" format="yyyy-MM-dd" /></span>
	                                        <a href="news!read.do?id=<s:property value="id"/>" title="<s:property value="title"/>"><s:property value="title"/></a>
	                                    	<s:if test="isNew">
	                                    	<i class="new"></i>
	                                    	</s:if>
	                                    </li>
                                	</s:iterator>
                                                                      
                                </ul>
                        	</div>
                           
                        </div>
                    </div>
                    </s:if>
                    
                    <s:if test="(rollmList != null && rollmList.size() > 0) || (rollsList != null && rollsList.size() > 0)">
                    <!-- xueji -->
                    <div class="info_box">
                    	<h3>
                        	<img src="images/other/title_1.jpg" />
                            <span>学籍</span>
                        </h3>
                        <s:if test="rollmList.size() > 0 ">
                        <div class="info_det_s1">
                        	<h4>
                            	<a href="news!view.do?category=7" class="more">MORE</a>
                                <span>中学学籍</span>
                                <ul class="tabs_nav">
                                	<li class="current"><a href="javascript:void(0);">全部</a></li>
                                	<li ><a href="javascript:void(0);">政策</a></li>
                                    <li ><a href="javascript:void(0);">信息</a></li>
                                </ul>
                            </h4>
                            <div class="tabs_box tabs">
                                <ul>
                                	<s:iterator id="rollm" value="rollmList" status="status">
                                		<li  <s:if test="type == 1">class='zc'</s:if><s:if test="type == 2">class='xx'</s:if>>
	                                        <span class="time"><s:date name="modifyDate" format="yyyy-MM-dd" /></span>
	                                        <a href="news!read.do?id=<s:property value="id"/>" title="<s:property value="title"/>"><s:property value="title"/></a>
	                                    	<s:if test="isNew">
	                                    	<i class="new"></i>
	                                    	</s:if>
	                                    </li>
                                	</s:iterator>
                                                                      
                                </ul>
                        	</div>
                        </div>
                        </s:if>
                        <s:if test="rollsList.size() > 0 ">
                        <div class="info_det_s1">
                        	<h4>
                            	<a href="news!view.do?category=8" class="more">MORE</a>
                                <span>小学学籍</span>
                                <ul class="tabs_nav">
                                	<li class="current"><a href="javascript:void(0);">全部</a></li>
                                	<li ><a href="javascript:void(0);">政策</a></li>
                                    <li ><a href="javascript:void(0);">信息</a></li>
                                </ul>
                            </h4>
                            <div class="tabs_box tabs">
                                <ul>
                                	<s:iterator id="rolls" value="rollsList" status="status">
                                		<li  <s:if test="type == 1">class='zc'</s:if><s:if test="type == 2">class='xx'</s:if>>
	                                        <span class="time"><s:date name="modifyDate" format="yyyy-MM-dd" /></span>
	                                        <a href="news!read.do?id=<s:property value="id"/>"><s:property value="title"/></a>
	                                    	<s:if test="isNew">
	                                    	<i class="new"></i>
	                                    	</s:if>
	                                    </li>
                                	</s:iterator>
                                                                      
                                </ul>
                        	</div>
                           
                        </div>
                        </s:if>
                    </div>
                    </s:if>
                    <!-- education -->
                    
                    <s:if test="infoList.size() > 0">
                    <div class="info_box">
                    	<h3>
                        	<img src="images/other/title_1.jpg" />
                            <span>教育局工作</span>
                        </h3>
                        <div class="info_det_s1">
                        	<h4>
                            	<a href="news!view.do?category=9" class="more">MORE</a>
                                <span>教学信息</span>
                                <ul class="tabs_nav">
                                	<li class="current"><a href="javascript:void(0);">全部</a></li>
                                	<li ><a href="javascript:void(0);">政策</a></li>
                                    <li ><a href="javascript:void(0);">信息</a></li>
                                </ul>
                            </h4>
                            <div class="tabs_box tabs">
                                <ul>
                                	<s:iterator id="info" value="infoList" status="status">
                                		<li  <s:if test="type == 1">class='zc'</s:if><s:if test="type == 2">class='xx'</s:if>>
	                                        <span class="time"><s:date name="modifyDate" format="yyyy-MM-dd" /></span>
	                                        <a href="news!read.do?id=<s:property value="id"/>" title="<s:property value="title"/>"><s:property value="title"/></a>
	                                    	<s:if test="isNew">
	                                    	<i class="new"></i>
	                                    	</s:if>
	                                    </li>
                                	</s:iterator>
                                                                      
                                </ul>
                        	</div>
                            
                        </div>
                    </div>
                     </s:if>    
                </div>
            </div>
            
            <!-- right -->
            <div class="i_right">
            	<div class="i_pd_s2">
                	<div class="box_s1 mb10">
                    	<h3 class="title">公告栏</h3>
                        <div class="com_lr">
                        	<div class="l_box">
                            	<img src="images/other/icon_3.jpg" class="block" />
                            </div>
                            <div class="r_box">
                            	<ul>
                            		<s:iterator id="announce" value="announceList" status="status">
                                		<li>
	                                    	<a href="news!read.do?id=<s:property value="id" />"><s:property value="title"/></a><s:if test="isNew"><i class="new"></i></s:if>
	                                    </li>
                                	</s:iterator>
                                </ul>
                            </div>
                        </div>
                    </div>
                    
                    <div class="box_s1 mb10">
                    	<h3 class="title">工作日程</h3>
                        <div id="dateBox">
                    		
                   		</div>
                    </div>
                    
                    <div class="box_s1 red_title mb10">
                    	<h3 class="title">邮件Inbox：</h3>
                        <div class="com_lr">
                        	<div class="l_box">
                            	<img src="images/other/icon_6.jpg" class="block" />
                            </div>
                            <div class="r_box">
                            	<ul>
                            		<s:iterator id="mail" value="mailList" status="status">
                                		<li <s:if test="!isRead">class="no_read"</s:if>>
                                    	<a href="mail!readmail.do?messageId=<s:property value="id"/>"><s:property value="title"/></a>
                                   		 </li>
                                	</s:iterator>
                                </ul>
                            </div>
                        </div>
                    </div>
                    
                    <div class="box_s1 red_title mb10">
                    	<h3 class="title">短消息Inbox：</h3>
                        <div class="com_lr">
                        	<div class="l_box">
                            	<img src="images/other/icon_8.jpg" class="block" />
                            </div>
                            <div class="r_box">
                            	<ul>
                            		<s:iterator id="short" value="shortList" status="status">
                                		<li <s:if test="!isRead">class="no_read"</s:if>>
                                    		<a href="message!readmsg.do?messageId=<s:property value="id"/>"><s:property value="content"/></a>
                                   		</li>
                                	</s:iterator>
                            		
                                </ul>
                            </div>
                        </div>
                    </div>
                    
                    
                </div>
            </div>
            <!--right--end-->
            <br class="clear" />
        </div>
    </div>
    <!-- body--end-->
    <%@include file="../common/footer.jsp" %>
    <!-- foot--end-->
<script type="text/javascript">
	$(function(){
		
		$.fn.dateBuilder({
			dbID:"mydb",
			afterDateBuilder:function(){
				var currentDate=new Date(),currentYear=currentDate.getFullYear(),currentMonth=currentDate.getMonth();
				currentMonth+=1;
				if(currentMonth < 10){
					currentMonth = "0"+currentMonth;
				}
				$.post("schedule!hasdays.do",{
					yearMonth:currentYear+"-"+currentMonth
				},function(data){
					var ret=$.parseJSON(data);
					$.each(ret.days,function(index,item){
						var date=item;
						date = date.substring(8);
						$("#mydb").find("td").filter(function(){
								if($(this).text()==parseInt(date,10)){
									return true;
								}
							}).wrapInner("<a href='###' yearMonth='"+currentYear+"-"+currentMonth+"' onclick='showSchList(this)'></a>").addClass("yellow");
						
							
						
					});
					
					if('<s:property value="#session.member.role.scheduleMang" />' == 'true'){
						$("#mydb td").filter(function(){
							var aobj = $(this).find("a");
							if(aobj.size() < 1 && $(this).text() != null && $(this).text() != ''){
								return true;
							}
						}).wrapInner("<a href='###' yearMonth='"+currentYear+"-"+currentMonth+"' onclick='showSchList(this)'></a>");
					}
				});
				
			}
		});
		
		var cYear,paraYear;
		var cMonth,paraMonth;
		$("table.dataBuilder").find("span.before").live("click",function(){
			cYear=$("table.dataBuilder").find("i.year").text();
			cMonth=$("table.dataBuilder").find("i.month").text();
			
			if(cMonth==1){
				paraYear=cYear-1;
				paraMonth=11;
			}else{
				paraYear=cYear;
				paraMonth=cMonth-2;
			}
			//alert(paraYear+"--"+paraMonth);
			$.fn.showDate({
				year:paraYear,
				month:paraMonth,
				afterShowDate:function(){
					var currentYear = paraYear;
					var currentMonth = paraMonth;
					currentMonth = parseInt(currentMonth)+1;
					if(currentMonth < 10){
						currentMonth = "0"+currentMonth;
					}
					$.post("schedule!hasdays.do",{
						yearMonth:paraYear+"-"+currentMonth
					},function(data){
						var ret=$.parseJSON(data);
						$.each(ret.days,function(index,item){
							var date=item;
							date = date.substring(8);
							$("#mydb").find("td").filter(function(){
								if($(this).text()==parseInt(date,10)){
									return true;
								}
							}).wrapInner("<a href='###' yearMonth='"+currentYear+"-"+currentMonth+"' onclick='showSchList(this)'></a>").addClass("yellow");
						
							
						});
						if('<s:property value="#session.member.role.scheduleMang" />' == 'true'){
							$("#mydb").find("td").filter(function(){
								var aobj = $(this).find("a");
								if(aobj.size() < 1 && $(this).text() != null && $(this).text() != ''){
									return true;
								}
							}).wrapInner("<a href='###' yearMonth='"+currentYear+"-"+currentMonth+"' onclick='showSchList(this)'></a>");
						}
					});
					
					
				}	
			});
			
		});
		
		$("table.dataBuilder").find("span.after").live("click",function(){
			cYear=$("table.dataBuilder").find("i.year").text();
			cMonth=$("table.dataBuilder").find("i.month").text();
			
			if(cMonth==12){
				paraYear=parseInt(cYear)+1;
				paraMonth=0;
			}else{
				paraYear=cYear;
				paraMonth=cMonth;
			}
			//alert(paraYear+"--"+paraMonth);
			$.fn.showDate({
				year:paraYear,
				month:paraMonth,
				afterShowDate:function(){
					var currentYear = paraYear;
					var currentMonth = paraMonth;
					currentMonth = parseInt(currentMonth)+1;
					if(currentMonth < 10){
						currentMonth = "0"+currentMonth;
					}
					$.post("schedule!hasdays.do",{
						yearMonth:paraYear+"-"+currentMonth
					},function(data){
						var ret=$.parseJSON(data);
						$.each(ret.days,function(index,item){
							var date=item;
							date = date.substring(8);
							
							$("#mydb").find("td").filter(function(){
								if($(this).text()==parseInt(date,10)){
									return true;
								}
							}).wrapInner("<a href='###' yearMonth='"+currentYear+"-"+currentMonth+"' onclick='showSchList(this)'></a>").addClass("yellow");
							
							
						});
						
						if('<s:property value="#session.member.role.scheduleMang" />' == 'true'){
							$("#mydb").find("td").filter(function(){
								var aobj = $(this).find("a");
								if(aobj.size() < 1 && $(this).text() != null && $(this).text() != ''){
									return true;
								}
							}).wrapInner("<a href='###' yearMonth='"+currentYear+"-"+currentMonth+"' onclick='showSchList(this)'></a>");
						}
					});
					
					
				}
			});
		});
		
		$("div.select_date").find("a.insure").live("click",function(){
			paraYear=$("table.dataBuilder").find("i.year").text();
			paraMonth=$("table.dataBuilder").find("i.month").text();
			$.fn.showDate({
				afterShowDate:function(){
					var currentYear = paraYear;
					var currentMonth = paraMonth;
					currentMonth = parseInt(currentMonth);
					if(currentMonth < 10){
						currentMonth = "0"+currentMonth;
					}
					$.post("schedule!hasdays.do",{
						yearMonth:paraYear+"-"+currentMonth
					},function(data){
						var ret=$.parseJSON(data);
						$.each(ret.days,function(index,item){
							var date=item;
							date = date.substring(8);
							$("#mydb").find("td").filter(function(){
								if($(this).text()==parseInt(date,10)){
									return true;
								}
							}).wrapInner("<a href='###' yearMonth='"+currentYear+"-"+currentMonth+"' onclick='showSchList(this)'></a>").addClass("yellow");
						
							
						});
						
						if('<s:property value="#session.member.role.scheduleMang" />' == 'true'){
							$("#mydb").find("td").filter(function(){
								var aobj = $(this).find("a");
								if(aobj.size() < 1 && $(this).text() != null && $(this).text() != ''){
									return true;
								}
							}).wrapInner("<a href='###' yearMonth='"+currentYear+"-"+currentMonth+"' onclick='showSchList(this)'></a>");
						}
					});
					
					
				}
			});
		});
		
		
	});
	
	function showSchList(obj){
		var day = $(obj).attr('yearmonth')+'-'+$(obj).text();
		window.location.href="schedule!view.do?day="+day;
		
	}
</script>
</body>
</html>
